package org.sgx.gapi.client.apis.tasks.tasks;

import java.util.Collection;

import org.sgx.gapi.client.client.GAPIBase;

import com.google.gwt.core.client.JsArray;

/**
 * @see https://developers.google.com/google-apps/tasks/v1/reference/tasks#resource
 * @author sg
 * 
 */
public class Task extends GAPIBase {
	protected Task() {
	}

	public static final native Task create()/*-{
		return {};
	}-*/;
	/**
	 * Title of the task.
	 * 
	 * @return
	 */
	public native final String title() /*-{
		return this["title"];
	}-*/;

	/**
	 * Title of the task.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final Task title(String val) /*-{
		this["title"] = val;
		return this;
	}-*/;

	/**
	 * Last modification time of the task (as a RFC 3339 timestamp).
	 * 
	 * @return
	 */
	public native final String updated() /*-{
		return this["updated"];
	}-*/;

	/**
	 * Last modification time of the task (as a RFC 3339 timestamp).
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final Task updated(String val) /*-{
		this["updated"] = val;
		return this;
	}-*/;

	/**
	 * URL pointing to this task. Used to retrieve, update, or delete this task.
	 * 
	 * @return
	 */
	public native final String selfLink() /*-{
		return this["selfLink"];
	}-*/;

	/**
	 * URL pointing to this task. Used to retrieve, update, or delete this task.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final Task selfLink(String val) /*-{
		this["selfLink"] = val;
		return this;
	}-*/;

	/**
	 * Parent task identifier. This field is omitted if it is a top-level task. This field is read-only. Use the "move" method to move the task under a different parent or to the
	 * top level.
	 * 
	 * @return
	 */
	public native final String parent() /*-{
		return this["parent"];
	}-*/;

	/**
	 * Parent task identifier. This field is omitted if it is a top-level task. This field is read-only. Use the "move" method to move the task under a different parent or to the
	 * top level.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final Task parent(String val) /*-{
		this["parent"] = val;
		return this;
	}-*/;

	/**
	 * String indicating the position of the task among its sibling tasks under the same parent task or at the top level. If this string is greater than another task's
	 * corresponding position string according to lexicographical ordering, the task is positioned after the other task under the same parent task (or at the top level). This field
	 * is read-only. Use the "move" method to move the task to another position.
	 * 
	 * @return
	 */
	public native final String position() /*-{
		return this["position"];
	}-*/;

	/**
	 * String indicating the position of the task among its sibling tasks under the same parent task or at the top level. If this string is greater than another task's
	 * corresponding position string according to lexicographical ordering, the task is positioned after the other task under the same parent task (or at the top level). This field
	 * is read-only. Use the "move" method to move the task to another position.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final Task position(String val) /*-{
		this["position"] = val;
		return this;
	}-*/;

	/**
	 * Notes describing the task. Optional.
	 * 
	 * @return
	 */
	public native final String notes() /*-{
		return this["notes"];
	}-*/;

	/**
	 * Notes describing the task. Optional.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final Task notes(String val) /*-{
		this["notes"] = val;
		return this;
	}-*/;

	/**
	 * Status of the task. This is either "needsAction" or "completed".
	 * 
	 * @return
	 */
	public native final String status() /*-{
		return this["status"];
	}-*/;

	/**
	 * Status of the task. This is either "needsAction" or "completed".
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final Task status(String val) /*-{
		this["status"] = val;
		return this;
	}-*/;

	/**
	 * Due date of the task (as a RFC 3339 timestamp). Optional.
	 * 
	 * @return
	 */
	public native final String due() /*-{
		return this["due"];
	}-*/;

	/**
	 * Due date of the task (as a RFC 3339 timestamp). Optional.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final Task due(String val) /*-{
		this["due"] = val;
		return this;
	}-*/;

	/**
	 * Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed.
	 * 
	 * @return
	 */
	public native final String completed() /*-{
		return this["completed"];
	}-*/;

	/**
	 * Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final Task completed(String val) /*-{
		this["completed"] = val;
		return this;
	}-*/;

	/**
	 * Flag indicating whether the task has been deleted. The default if False.
	 * 
	 * @return
	 */
	public native final boolean deleted() /*-{
		return this["deleted"];
	}-*/;

	/**
	 * Flag indicating whether the task has been deleted. The default if False.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final Task deleted(boolean val) /*-{
		this["deleted"] = val;
		return this;
	}-*/;

	/**
	 * Flag indicating whether the task is hidden. This is the case if the task had been marked completed when the task list was last cleared. The default is False. This field is
	 * read-only.
	 * 
	 * @return
	 */
	public native final boolean hidden() /*-{
		return this["hidden"];
	}-*/;

	/**
	 * Flag indicating whether the task is hidden. This is the case if the task had been marked completed when the task list was last cleared. The default is False. This field is
	 * read-only.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final Task hidden(boolean val) /*-{
		this["hidden"] = val;
		return this;
	}-*/;

	/**
	 * Collection of links. This collection is read-only.
	 * 
	 * @return
	 */
	public native final JsArray<TaskLink> links() /*-{
		return this["links"];
	}-*/;

	/**
	 * Collection of links. This collection is read-only.
	 * 
	 * @return
	 */
	public native final Collection<TaskLink> linksCol() /*-{
		return @org.sgx.jsutil.client.JsUtil::toJavaCollection(Lcom/google/gwt/core/client/JavaScriptObject;)(this["links"]);
	}-*/;

	/**
	 * Collection of links. This collection is read-only.
	 * 
	 * @param val
	 * @return this - for setter chaining
	 */
	public native final Task links(JsArray<TaskLink> val) /*-{
		this["links"] = val;
		return this;
	}-*/;
}
